import Shouye from '../views/Shouye.vue'
import User from '../views/User.vue'
import tuijie from '../views/shouye/tuijie.vue'
import Msssage from '../views/Msssage.vue'
import Service from '../views/Service.vue'
import guanzhu from '../views/shouye/guanzhu.vue'
import changsha from '../views/shouye/changsha.vue'
import deng from '../views/user/deng.vue'
import goumai from '../views/Msssage/goumai.vue'
import xiaoxi from '../views/Service/xiaoxi.vue'
import { createRouter, createWebHashHistory } from "vue-router"
const router = createRouter({
    history:createWebHashHistory(),
    routes:[
        // {path:'/',redirect:'/index',meta:{title:'首页'},name:'index'},
        // {path:'/index',component:Index,meta:{title:'首页'}},
        {path:'/user',component:User,meta:{title:'用户中心'}},
        {path:'/shouye',component:Shouye,meta:{title:'首页'}},
        {path:'/msssage',component:Msssage,meta:{title:'信息模块'}},
        {path:'/service',component:Service,meta:{title:'客服模块'}},
        {path:'/tuijie',component:tuijie,meta:{title:'推荐模块'}},
        {path:'/guanzhu',component:guanzhu,meta:{title:'关注模块'}},
        {path:'/changsha',component:changsha,meta:{title:'长沙模块'}},
        {path:'/deng',component:deng,meta:{title:'登录模块'}},
        {path:'/goumai',component:goumai,meta:{title:'购买模块'}},
        {path:'/xiaoxi',component:xiaoxi,meta:{title:'消息模块'}},
    ]
})
router.beforeEach((to,from,next)=>{
    document.title=to.meta.title
    next()
})
export default router